package com.itheima.genericity;

import java.util.ArrayList;

public class generdemo03 {
    public static void main(String[] args) {
        ArrayList<String> list1=getElement(new ArrayList<String>(),"a","b","c","d");
        System.out.println(list1);
        ArrayList<Integer> list2=getElement(new ArrayList<Integer>(),1,2,3,4);
        System.out.println(list2);

    }
    public static <T> ArrayList<T> getElement(ArrayList<T> list,T t1,T t2,T t3,T t4){
        list.add(t1);
        list.add(t2);
        list.add(t3);
        list.add(t4);
        return list;
    }
}
